
import proFetch from '../../../../../hrpub/common/utils/project-fetch';

import {
    promptBox
} from 'nc-lightapp-front';

import language from '../../language';

export default function () {

    const {editTable} = this.props;
    const {humanResourceOrganizationValue} = this.state;

    let selectedData = editTable.getCheckedRows('ncc600704list');

    let param_str = [];

    selectedData.map((item) => {
        param_str.push(item.data.values['pk_psnjob'].value);
    });

    proFetch({
        url: '/nccloud/hrhi/register/RegisterNewEntryCheckAction.do',
        body: {
            param_str: param_str.join(','),
            pk_org: humanResourceOrganizationValue.refpk
        }
    })
        .then((res) => {
            if(res.data.confirmMsg) {
                promptBox({
                    color: "warning",
                    title: language['hi6007-000008'],/* 国际化处理： 提示*/
                    content: res.data.confirmMsg,
                    beSureBtnClick: async () => {
                        this.setState({
                            entryApplyModalVisible: true,
                            entryApplyListPks: res.data.listpks
                        });
                    }
                });
            }
            else {
                this.setState({
                    entryApplyModalVisible: true,
                    entryApplyListPks: res.data.listpks
                });
            }
            
        });
}